<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        .main {
            display: flex;
        }
        
        .wrap {
            width: 350px;
            height: 500px;
            background: yellow;
            margin-right: 50px;
            display: grid;
            grid-template-rows: repeat(3, 100px);
            grid-template-columns: repeat(3, 100px);
        }
        
        .wrap div {
            border: 1px solid #000;
        }
        
        .wrap1 {
            grid-row-gap: 10px;
            /* 行间隙 */
        }
        
        .wrap2 {
            grid-column-gap: 20px;
            /* 列间隙 */
        }
        
        .wrap3 {
            grid-gap: 10px;
            /* 行列之间都有间隙 */
        }
        
        .wrap4 {
            grid-gap: 10px 20px;
            /* 10像素行间隙，20像素列间隙 */
        }
    </style>
</head>

<body>
    <div class="main">
        <!-- 3*3 的网格 -->
        <div class="wrap wrap1">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
            <div>7</div>
            <div>8</div>
            <div>9</div>
        </div>
        <div class="wrap wrap2">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
            <div>7</div>
            <div>8</div>
            <div>9</div>
        </div>
        <div class="wrap wrap3">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
            <div>7</div>
            <div>8</div>
            <div>9</div>
        </div>
        <div class="wrap wrap4">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
            <div>7</div>
            <div>8</div>
            <div>9</div>
        </div>
    </div>
</body>

</html>